package es.ucm.fdi.lps.abadia.interfazgrafica;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import java.awt.Window.Type;

import javax.swing.JLabel;

import java.awt.Font;

import javax.swing.SwingConstants;
import javax.swing.JButton;

import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Entrada extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Entrada frame = new Entrada();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Entrada() {
		setType(Type.UTILITY);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 455, 152);
		setLocationRelativeTo(null);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("EL MISTERIO DE LA ABADIA VERSI\u00D3N DIGITAL");
		lblNewLabel.setForeground(Color.RED);
		lblNewLabel.setBounds(21, 10, 391, 23);
		lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
		lblNewLabel.setFont(new Font("Tempus Sans ITC", Font.BOLD | Font.ITALIC, 17));
		contentPane.add(lblNewLabel);
		
		JPanel panel = new JPanel();
		panel.setToolTipText("");
		panel.setBounds(95, 44, 241, 64);
		contentPane.add(panel);
		
		JButton btnCrea = new JButton("CREAR PARTIDA EN RED");
		btnCrea.setForeground(Color.BLUE);
		btnCrea.setFont(new Font("Tempus Sans ITC", Font.BOLD, 11));
		panel.add(btnCrea);
		
		
		JButton btnUne = new JButton("UNIRSE A PARTIDA EN RED");
		btnUne.setForeground(Color.BLUE);
		btnUne.setFont(new Font("Tempus Sans ITC", Font.BOLD, 11));
		btnUne.setHorizontalAlignment(SwingConstants.RIGHT);
		panel.add(btnUne);
		
		//Tratamos los eventos de click en ambos botones.
		
		btnCrea.addActionListener(new ActionListener() 
		{
			public void actionPerformed(ActionEvent e)
			{
				System.exit(0);
			}
		}
		);
		
		btnUne.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				System.exit(0);
			}
		});
		
	}
}
